pub fn min_start_value(nums: Vec<i32>) -> i32 {
    let mut sum = 0;
    let mut min_sum = 0;
    for i in 0..nums.len() {
        sum += nums[i];
        if sum < min_sum {
            min_sum = sum;
        }
    }

    return if min_sum >= 0 {
        1
    } else {
        0 - min_sum + 1
    };
}

#[test]
fn test_min_start_value() {
    println!("{}", min_start_value(vec![-3, 2, -3, 4, 2]));
    println!("{}", min_start_value(vec![1, 2]));
    println!("{}", min_start_value(vec![1, -2, -3]))
}